<?php

function curPageURL() {
    $pageURL = 'http';
    if (isset( $_SERVER["HTTPS"] ) && strtolower( $_SERVER["HTTPS"] ) == "on") {$pageURL .= "s";}
    $pageURL .= "://";
    if ($_SERVER["SERVER_PORT"] != "80") {
     $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
    } else {
     $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    }
    return $pageURL;
   }

function asset_url($FromSystem = false){
    if($FromSystem)
        return 'assets/';
    else
        return base_url().'assets/';
}

function css_url($FromSystem = false){
    if($FromSystem)
        return asset_url(true).'css/';
    else
        return asset_url().'css/';
}

function view_path(){
    return 'application/views/';
}

function image_url($FromSystem = false){
    if($FromSystem)
        return asset_url(true).'images/';
    else
        return asset_url().'images/';
}

function js_url($FromSystem = false){
    if($FromSystem)
        return asset_url(true).'js/';
    else
        return asset_url().'js/';
}

function tool_calendar($FromSystem = false){  
    if($FromSystem)
        return asset_url(true).'jqueryCalendar/';
    else
        return asset_url().'jqueryCalendar/';
}

function root_url(){
    return substr(site_url(),0,-9);
}

function classes_path(){
    return 'application/classes/';
}